﻿@model PaggerApplication.Models.PageViewModel<PaggerApplication.Models.ProductModel>
@{
    PaggerApplication.Models.SearchModel searchModel = ViewBag.SearchModel;
    if (searchModel == null)
    {
        searchModel = new PaggerApplication.Models.SearchModel();
    }
    ViewBag.Title = "Numeric POST";
    Layout = "~/Views/Shared/_AjaxLayout.cshtml";
}
<script type="text/javascript" src="@Url.Content("~/Scripts/AjaxNumericPagger.js")"></script>
<h2>
    Numeric Pagger - POST</h2>
@using ( Html.BeginForm () ) {
    @(Html.ValidationSummary ( true, "Search Condition Error." ))
    <div>
        <fieldset>
            <legend>Search Product</legend>
            <div class="editor-field">
                <span>Count</span>
                <input type="text" name="MinCount" value="@searchModel.MinCount" />
                <span>~ </span>
                <input type="text" name="MaxCount" value="@searchModel.MaxCount" />
                <input type="submit" value="Query" />
            </div>
        </fieldset>
    </div>
}
<table>
    <thead>
        <tr>
            <th>
                ID
            </th>
            <th>
                Name
            </th>
            <th>
                Specification
            </th>
            <th>
                Price
            </th>
            <th>
                Count
            </th>
        </tr>
    </thead>
    <tbody id="tableBody">
        @Html.Partial("_DataRow", Model)
    </tbody>
</table>
@Ajax.Pagger("NumericPost", Model.RowCount, Model.PageIndex, Model.PageSize, AjaxPaggerType.Numeric, 
new AjaxOptions()
{
    HttpMethod = "POST",
    UpdateTargetId = "tableBody"    
})
